/**
 * 
 */
package edu.umd.clip.lm.model.data;

import java.io.IOException;
import java.nio.channels.ReadableByteChannel;

/**
 * @author Denis Filimonov <den@cs.umd.edu>
 *
 */
public class ReadableTrainingDataNode extends AbstractTrainingDataNode {
	private ReadableTrainingData data[];
	
	public ReadableTrainingDataNode(int nodeId, ReadableTrainingData[] data) {
		super(nodeId, data.length);
		setData(data);
	}

	/**
	 * @param channel
	 * @throws IOException
	 */
	public ReadableTrainingDataNode(ReadableByteChannel channel)
			throws IOException {
		super(channel);
	}

	public ReadableTrainingData[] getData() {
		return data;
	}

	public void setData(ReadableTrainingData[] data) {
		this.data = data;
	}

	public ReadableTrainingData getData(int num) {
		return data[num];
	}

	public void setData(int num, ReadableTrainingData data) {
		this.data[num] = data;
	}
	
	public void skipData() throws IOException {
		for(ReadableTrainingData d : data) {
			while(d.hasNext()) {
				d.next();
			}
		}
	}
}
